package org.jeecg.modules.basedata.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.entity.basedata.BaseProject;
import org.jeecg.modules.system.model.TreeSelectModel;
import org.jeecg.vo.basedata.BaseProjectPage;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.model.SysDepartTreeModel;

import java.util.List;

/**
 * @Description: 项目
 * @Author: jeecg-boot
 * @Date:   2019-06-18
 * @Version: V1.0
 */
public interface BaseProjectMapper extends BaseMapper<BaseProject> {

    public BaseProjectPage selectByMainId(String mainId);

    public List<SysDepart> queryProjectTreeList(String userId);
    public List<SysDepart> queryProjectTreeLists(String userId);

    public List<SysDepart> queryProjectTreeListOne(String userId);

    public List<SysDepartTreeModel> queryUnitTreeList(@Param("projectId") String projectId);

    public List<SysDepart> queryCarParkTreeList();

    public List<SysDepartTreeModel> queryTenantList(@Param("floorId") String floorId);//租户树结构数据

    public Integer queryTenantListCount(@Param("floorId") String floorId);

    public Integer queryCustomerListCount(@Param("floorId") String floorId);

    public List<SysDepartTreeModel> queryCustomerList(@Param("floorId") String floorId);//业主树结构数据

    public List<SysDepartTreeModel> queryOutCustomer(@Param("floorId") String floorId);//迁出业主树结构数据

    List<BaseProject> findProjectList(String userId);

    BaseProject getProjectById(String projectId);

    //项目管理分页+模糊查询
    List<BaseProject> listByParams(@Param("page") Page<BaseProject> page, @Param("baseProject")BaseProject baseProject);

    @SqlParser(filter = true)
    List<BaseProject> findProjectAll();

    //查询小区是否有楼宇绑定
    public Integer getFloorCount(String id);

    public Integer getFloorCounts(@Param("ids") String[] ids);

    List<SysDepartTreeModel> queryProjectTreeByKeywords(@Param("keyWord")String keyWord,@Param("ids")List<String> projectIds);

    List<SysDepartTreeModel> queryOfficeTreeByKeywords(@Param("keyWord") String keyWord, @Param("ids")List<String> officeIds);

    List<SysDepartTreeModel> getByProjectIds(@Param("baseProject")BaseProject baseProject);

    BaseProject getProjectByName(String projectName);


    List<TreeSelectModel> getByFloorTreeList(@Param("projectId") String projectId);


}
